package com.tqjc.system.common.constant;

import com.tqjc.system.common.entity.BO.MaterialSpanBO;
import com.tqjc.system.common.entity.BO.TankCarTaskInfoBO;
import com.tqjc.system.common.entity.BO.TaskMaterialBO;
import com.tqjc.system.core.pipeline.thread.AbstrCarDoingAddTaskThread;
import com.tqjc.system.core.pipeline.thread.CarDoingAddTaskThread;
import com.tqjc.system.core.pipeline.thread.SendTankPositionThread;
import org.apache.commons.collections4.Put;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Queue;

/**
 * @author 86195
 * @version 1.0
 * @description 加料任务常量类
 * @date 2023/10/17 11:15
 */
public class AddTaskConstant {

    /**
     * 初始状态都为0   空闲状态    1：工作状态
     */
    public static final Map<String,MaterialSpanBO> SPAN_MAP = new HashMap<String,MaterialSpanBO>(){{
       put(AddTaskConstant.DREGS_STEEL_SPAN_NO,MaterialSpanBO.builder().spanNo("2").spanName("渣跨").status("0").build());
       put(AddTaskConstant.WASTE_STEEL_SPAN_NO,MaterialSpanBO.builder().spanNo("1").spanName("废钢跨").status("0").build());

    }};




    /**
     * 废钢跨编码
     */
    public static final String WASTE_STEEL_SPAN_NO = "1";

    /**
     * 是否启用槽车扫描标识   false：不启用   true：启用
     */
    public static boolean TANKCAR_SCAN_USE_FLAG;

    /**
     * 是否检查天车模式状态开关扫描标识   false：不启用   true：启用
     */
    public static boolean CAR_STATUS_FLAG;


    /**
     * 废渣跨编码
     */
    public static final String DREGS_STEEL_SPAN_NO = "2";


    public static final String SPAN_STATUS_FREE = "0";

    public static final String SPAN_STATUS_WORK = "1";



    //缓存当前各天车目标位置缓存  key：spanNo + _ + carNo   value:目标坐标
    public static final Map<String, Integer> CAR_TARGET_INDEX_MAP = new HashMap<>(4);


    //缓存当前各天车线程缓存缓存  key：carName   value:行车线程
    public static final Map<String, AbstrCarDoingAddTaskThread> CAR_THREAD_MAP = new HashMap<>(4);

    /**
     * 移动锁前缀
     */
    public static final String CAR_MOVE_LACK_PREFIX = "car_move_lack_";

    public static final String CAR_MOVE_LACK_1 = "car_move_lack_1";

    public static final String CAR_MOVE_LACK_2 = "car_move_lack_2";


    public static final String ACT_MOVE = "move";

    public static final String ACT_AVOID = "avoid";


    public static final String ACT_PUT = "put";

    public static final String ACT_SUCK = "suck";

    /**
     * 槽车任务类型  加料
     */
    public static final String TANK_CAR_TASK_TYPE_ADD = "1";

    /**
     * 槽车任务类型  卸料
     */
    public static final String TANK_CAR_TASK_TYPE_UNLOAD= "2";

    /**
     * 槽车运行移动
     */
    public static final String TANK_CAR_ALLOW_MOVE = "true";



    /**
     * 天车运行移动
     */
    public static final String CAR_ALLOW_MOVE = "true";


    /**
     * 天车运行移动
     */
    public static final String CAR_FORBID_MOVE = "false";

    /**
     * 槽车运行暂停移动
     */
    public static final String TANK_CAR_NOT_ALLOW_MOVE = "false";


    /**
     * 天车任务未完成
     */
    public static final String CAR_TASK_UNFINISH = "false";


    /**
     * 天车任务完成
     */
    public static final String CAR_TASK_FINISH = "1";


    /**
     * 天车任务类型  吸料
     */
    public static final String CAR_TASK_TYPE_SUCK = "1";



    /**
     * 天车任务类型  放料
     */
    public static final String CAR_TASK_TYPE_PUT = "2";



    /**
     * 天车任务类型  避让
     */
    public static final String CAR_TASK_TYPE_MOVE = "3";

    /**
     * 天车作业地点   料场
     */
    public static final String CAR_TASK_PLACE_MATERIAL = "1";

    /**
     * 天车作业地点   货车
     */
    public static final String CAR_TASK_PLACE_CAR = "2";



    /**
     * 天车选择  3  双车联动
     */
    public static final String CAR_NO_BOTH = "3";


    /**
     * 天车作业地点   槽车
     */
    public static final String CAR_TASK_PLACE_STEEL_CAR = "3";

    /**
     * 天车作业地点   火车
     */
    public static final String CAR_TASK_PLACE_TRAIN = "4";


    /**
     * 安全距离
     */
    public static final int SAFE_DISTANCE = 15000;


    public static final int SAFE_HEIGHT_DISTANCE = 9000;





    public static final Map<String, SendTankPositionThread> TANK_CAR_THREAD_MAP = new HashMap<String,SendTankPositionThread>(3);


    public static final Map<String, Queue<TankCarTaskInfoBO>> TANK_CAR_QUEUE_MAP = new HashMap<String,Queue<TankCarTaskInfoBO>>(3);





    public static int test_num = 100;

    public static int test_i = 0;

    public static final Map<String,Thread> map = new HashMap<String,Thread>();


    public static final String HEAT_SPAN_TANKCAR_INDEX = "80000";


    /**
     * 临时任务id
     */
    public static final String TEMP_TASK_ID = "0000";


    public static final String TASK_TYPE_MES = "MES";


    public static final String TASK_TYPE_TQ = "TQ";

    /**
     * 料场扫描  吸料类型
     */
    public static final int AREA_SCAN_TYPE_SUCK  = 0;


    /**
     * 料场扫描  放料类型
     */
    public static final int AREA_SCAN_TYPE_PUT  = 1;


    public static boolean TANK_CAR_NO1_FINISH_FLAG;

    public static boolean TANK_CAR_NO2_FINISH_FLAG;

    public static boolean TANK_CAR_NO3_FINISH_FLAG;


    public static String X_TARGET_LABEL = "大车目标坐标";

    public static String Y_TARGET_LABEL = "小车目标坐标";

    public static String WASTE_STEEL_CAR_NAME = "废钢跨天车";


    public static String DREGS_STEEL_CAR_NAME = "渣钢跨天车";


    public static int SCAN_VALID_COUNT = 4;





}
